Repository navigation
stream: emit end when paused on the last chunk - #67769
christianaurichzm wants to merge 1 commit into
Conversation
flowSync() calls _read() before delivering each chunk, like read(), but did not schedule 'end' when that call pushed EOF and nothing was left to deliver. A consumer that paused on the last chunk, such as pipe() after write() returned false, then got no 'end' until it resumed. Schedule endReadable() there, as read() does. Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #67769 +/- ##
=======================================
Coverage 90.54% 90.55%
=======================================
Files 803 803
Lines 285302 285307 +5
Branches 55074 55071 -3
=======================================
+ Hits 258324 258354 +30
+ Misses 17104 17099 -5
+ Partials 9874 9854 -20
🚀 New features to boost your workflow:
|
|
While I'm sorry for the breakage, but I think the current behavior is correct. |
|
Hi there! After chatting a bit in my agent session, it appears that indeed this bug isn't the right one, the other related issue is. This change did change observable behavior, which is why I ended up flagging it in the first place. Apologies for the mistake. Here's a better AI overview than mine: |
|
Makes sense, thanks. Async sources never got |
Since v26.11.0, a flowing
Readabledoesn't emit'end'when_read()pushes EOF in the call after the last chunk and the consumer pauses on that chunk:This prints
endon v22 and nothing onmain.pipe()pauses there whenwrite()returnsfalse, so the destination isn't ended unless it drains again.flowSync()from #66182 runs_read()before delivering each chunk, likeread(), but skips theendReadable()thatread()schedules when that_read()hits EOF. This schedules it at the same point.Thanks to @AZMCode for tracing this to
flowSync().Fixes: #67762